<?php

namespace app\admin\model\coupons;

use think\Model;


class Log extends Model
{

    

    

    // 表名
    protected $name = 'coupons_log';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'updateLocallist_text',
        'updateThirdlist_text'
    ];
    

    
    public function getUpdatelocallistList()
    {
        return ['0' => __('Updatelocallist 0'), '1' => __('Updatelocallist 1')];
    }

    public function getUpdatethirdlistList()
    {
        return ['0' => __('Updatethirdlist 0'), '1' => __('Updatethirdlist 1')];
    }


    public function getUpdatelocallistTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['updateLocallist']) ? $data['updateLocallist'] : '');
        $list = $this->getUpdatelocallistList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getUpdatethirdlistTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['updateThirdlist']) ? $data['updateThirdlist'] : '');
        $list = $this->getUpdatethirdlistList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
